package com.itheima.a05tesr;

/**
 * @author zhangbaiyan
 * @date 2024-09-09 08:10
 * @description:
 * @version:
 */
public abstract class animal<N,I> {
    private N name;
    private I age;


    public animal() {
    }

    public animal(N name, I age) {
        this.name = name;
        this.age = age;
    }

    /**
     * 获取
     * @return name
     */
    public N getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(N name) {
        this.name = name;
    }

    /**
     * 获取
     * @return age
     */
    public I getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(I age) {
        this.age = age;
    }

    abstract void eat();


    public String toString() {
        return "animal{name = " + name + ", age = " + age + "}";
    }
}
